#include <stdbool.h>

int mypow(int base, int exponent){
    int result = 1;
    for (int i = 1; i <= exponent; i ++){
        result = base * result;
    }
    return result;
}

bool is_armstrong_number(int candidate) {
    int remainder = candidate, digits = 0, sum = 0, dec;
    while(remainder > 0) {
        remainder = remainder / 10;
        digits++;
    }
    remainder = candidate;
    for(int i = 1; i <= digits; i++) {
        sum += mypow((remainder % 10),digits);
        remainder = remainder / 10;
    }
    return candidate == sum;
}

